package com.bazaaroid.mobile.rest.model.partner;

public class LocationItem {
	
	public static String KEY = "key";
	public static String NAME = "name";
	public static String ADDRESS = "address";
	public static String GEO_POINT = "geoPt";
	public static String OPENING_HRS = "openingHours";
	
	private String key;
	private String name;
	private AddressItem address;
	private GeoPointItem geoPt;
	private String openingHours;
	public void setKey(String key) {
		if(key.contains("Partner(") && key.contains(")/Location(") && key.contains(")"))
		{
			key = key.replace("Partner(", "");
			key = key.replace("Location(", "");
			key = key.replace(")", "");
			// 16001/101
			int index = key.indexOf("/");
			key = key.substring(++index, key.length());
		}
		else if(key.contains("Location(") && key.contains(")"))
		{
			key = key.replace("Location(", "");
			key = key.replace(")", "");
		}
		this.key = key;
	}
	public String getKey() {
		return key;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	public void setAddress(AddressItem address) {
		this.address = address;
	}
	public AddressItem getAddress() {
		return address;
	}
	public void setGeoPt(GeoPointItem geoPt) {
		this.geoPt = geoPt;
	}
	public GeoPointItem getGeoPt() {
		return geoPt;
	}
	public void setOpeningHours(String openingHours) {
		this.openingHours = openingHours;
	}
	public String getOpeningHours() {
		return openingHours;
	}
}
